<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:widgets="clr-namespace:Microsoft.Communications.Contacts.Widgets"
    >
    
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type widgets:ThumbnailView},ResourceId=ThumbnailView}"
           TargetType="{x:Type ListView}" BasedOn="{StaticResource {x:Type ListBox}}">
        <Setter Property="BorderBrush" Value="Black"/>
        <Setter Property="BorderThickness" Value="0.5"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
                            Background="{TemplateBinding Background}" Margin="{TemplateBinding Margin}">
                        <ScrollViewer Margin="{TemplateBinding Padding}">
                            <WrapPanel ItemWidth="150" IsItemsHost="True" MinWidth="170"
                                       Width="{Binding ActualWidth,RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}">
                            </WrapPanel>
                        </ScrollViewer>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type widgets:ThumbnailView},ResourceId=ThumbnailViewItem}"
           TargetType='{x:Type ListViewItem}' BasedOn='{StaticResource {x:Type ListBoxItem}}'>
        <Setter Property='Padding' Value='3'/>
        <Setter Property='Margin' Value='5'/>
        <Setter Property='HorizontalContentAlignment' Value='Center'/>
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <StackPanel>
                        <Border Background="White">
                            <Image Margin="3" Source="{Binding UserTile.Image}"/>
                        </Border>
                        <TextBlock TextAlignment="Center" Text="{Binding Names.Default.FormattedName}"/>
                    </StackPanel>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>